package de.toolschmied.jjas.client.cms.actions;

import de.toolschmied.jjas.client.widgets.toolbar.Action;

public class HeadingTypeAction extends Action {
	
	public interface HeadingTypeListener {
		
		public void headingTypeChanged(HeadingType headingType);
		
	}

	private final HeadingType headingType;
	private final HeadingTypeListener listener;
	
	public HeadingTypeAction(HeadingType headingType, HeadingTypeListener listener) {
		super(headingType.getName(), headingType.getTooltip(), headingType.getButtonImageURL(), Type.RADIO);
		this.headingType = headingType;
		this.listener = listener;
	}

	@Override
	public void run() {
		listener.headingTypeChanged(headingType);
	}

	public HeadingType getHeadingType() {
		return headingType;
	}

}
